package cn.tedu.backend.portal.mapper;

import cn.tedu.backend.portal.model.UserActivity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserActivityMapper extends BaseMapper<UserActivity> {
    //查询所有
    @Select("select * from user_activity")
    List<UserActivity> selectAll();

    //删除信息
    @Delete("delete from user_activity where useractivity_id=#{userActivityId}")
    int deleteByUserActivityId(int userActivityId);

    //统计用户参与活动数
    @Select("select count(distinct activity_id) from user_activity ")
    int selectUactCount();

}
